<template>
	<view class="CloudInteraction">
		<view :style="{'height': `${statusBarHeight}px`, 'background-color': '#060143'}"></view>
		<uni-nav-bar backgroundColor="#060143;" color="#FFF" :title="$t('language.meeting14')" @clickLeft="goBack" left-icon="left"
			:border="false" />
		
		<view class="logo">
			<image class="logo-ic" src="@/static/logo.png" alt="" />
			<view class="lang-wrap" @click="changeLanguage">
				<image src="../../static/100.png" mode=""></image>
				<text>{{$t('locale.lang')}}</text>
			</view>
		</view>
		<view class="VotingInfoHeader">
			<view class="title">{{$t('language.name') == '中文'? imgSrc.title:imgSrc.e_title}}</view>
			<view class="time" v-if="imgSrc.add_time">{{imgSrc.add_time}}</view>
			<view class="InfoBox">
				<view class="Info">
					<view class="InfoHtml" style="margin-bottom:30upx;" v-if="$t('language.name') == '中文'">
						{{imgSrc.intro}},
					</view>
					<view class="InfoHtml" style="margin-bottom:30upx;" v-else>
						{{imgSrc.e_intro}}
					</view>
					<image :src="imgSrc.image" mode=""></image>
					<view class="InfoHtml" v-if="$t('language.name') == '中文'" v-html="imgSrc.content"></view>
					<view class="InfoHtml" v-else v-html="imgSrc.e_content"></view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		HTTP_REQUEST_URL
	} from '@/config/app';
	import uniIcons from "@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
	import {
		intro_info
	} from "@/api/user";
	let timer = null
	export default {
		name: 'messageInfo',
		components: {
			uniIcons
		},
		data() {
			return {
				baseUrl: HTTP_REQUEST_URL,
				statusBarHeight: 44,
				title: '',
				evenId: '',
				id: '',
				imgSrc: '',
				ListBox: []
			}
		},
		onLoad(o) {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
			let evenId = o.evenId;
			this.evenId = evenId;
			this.id = o.id;
			this.getImgInfo();
		},
		created() {},
		methods: {
			getImgInfo() {
				intro_info({
					event_id: this.evenId,
					id: this.id
				}).then(
					response => {
						if (response.code == 200) {
							this.imgSrc = response.data;
						} else {
							uni.showToast({
								title: response.msg,
								icon: 'none'
							})
						}
					},
					err => {
						console.log(err)
					}
				);

			},
			toInfo(item) {
				console.log(item)
			},
			goBack() {
				uni.navigateBack()
			},
			changeLanguage() {
				if (this.$i18n.locale == 'zh') {
					this.$i18n.locale = 'en';
					uni.setStorageSync('locale', 'en')
				} else {
					this.$i18n.locale = 'zh';
					uni.setStorageSync('locale', 'zh')
				}
			}
		}
	}
</script>
<style scoped lang="scss">
	.CloudInteraction {
		min-height: 100vh;
		background-color: #050033;
		color: #fff;
	}

	.logo {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20upx 30upx;
		background-color: #060143;

		.logo-ic {
			width: 78upx;
			height: 64upx;
		}

		.lang-wrap {
			display: flex;
			align-items: center;
			color: #fff;
			font-size: 24upx;

			image {
				width: 30upx;
				height: 30upx;
				margin-right: 12upx;
			}
		}
	}

	page {
		background-color: #050033;
	}

	.headerChangeLanguage {
		height: 100upx;
		background: #fff;
		padding: 0 30upx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		box-shadow: 0 2upx 4upx #ccc;
		width: 100%;
		box-sizing: border-box;
	}

	.logo image {
		width: 178upx;
		height: 30upx;
	}


	.language {
		flex-shrink: 0;
	}

	.langeageZh {
		height: 30upx;
		width: 86upx;
		background: url($image-base-url + '/static/img/EN-17.png') no-repeat;
		background-size: 86upx 30upx;
	}

	.langeageEn {
		height: 30upx;
		width: 86upx;
		background: url($image-base-url + '/static/img/CH-17.png') no-repeat;
		background-size: 86upx 30upx;
	}

	.VotingInfoHeader {
		padding: 30upx;
		box-sizing: border-box;
	}

	.title {
		height: 92upx;
		line-height: 92upx;
		color: #fff;
		font-size: 32upx;
	}

	.time {
		color: #999999;
		font-size: 24upx;
		display: flex;
		margin-bottom: 60upx;
	}

	.Info image {
		width: 100%;
		display: block;
		margin-bottom: 30upx;
	}
</style>